package com.ruicar.afs.cloud.risk.api.dto.tortoise.request;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ruicar.afs.cloud.common.core.enums.AfsEnumDeserializer;
import com.ruicar.afs.cloud.common.core.enums.AfsEnumSerializer;
import com.ruicar.afs.cloud.risk.api.enums.tortoise.GwtTortoiseExposurePersonType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Description 敞口信息
 * @Author Peng Jinbo
 * @Date 2020/08/04 10:07
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class GwtExposureData implements Serializable {

    @JsonInclude
    @JSONField(name = "userid")
    @JsonProperty("userid")
    private String userId;

    /**
     * Main id
     * 订单ID
     */
    @JsonInclude
    @JSONField(name = "camainid")
    @JsonProperty("camainid")
    private String mainId;

    /**
     * Apply no
     * 订单编号
     */
    @JsonInclude
    @JSONField(name = "applicationno")
    @JsonProperty("applicationno")
    private String applyNo;

    /**
     * Brand name
     * 车型
     */
    @JsonInclude
    @JSONField(name = "brand")
    @JsonProperty("brand")
    private String brandName;

    @JsonInclude
    @JSONField(name = "cdate", format = "yyyy-MM-dd HH:mm:ss")
    @JsonProperty("cdate")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date applyDate;

    /**
     * Asset cost
     * 资产成本
     */
    @JsonInclude
    @JSONField(name = "allmoney")
    @JsonProperty("allmoney")
    private BigDecimal assetCost;

    /**
     * Business status name
     * 业务状态
     */
    @JsonInclude
    @JSONField(name = "status")
    @JsonProperty("status")
    private String businessStatusName;

    /**
     * Customer name
     * 主借人姓名
     */
    @JsonInclude
    @JSONField(name = "zjrname")
    @JsonProperty("zjrname")
    private String customerName;

    /**
     * Loan period
     * 贷款期限
     */
    @JsonInclude
    @JSONField(name = "loanperiod")
    @JsonProperty("loanperiod")
    private String loanPeriod;

    /**
     * Loan money
     * 贷款金额
     */
    @JsonInclude
    @JSONField(name = "loanmoney")
    @JsonProperty("loanmoney")
    private BigDecimal loanMoney;

    /**
     * Repay money
     * 已经偿还贷款金额
     */
    @JsonInclude
    @JSONField(name = "payed")
    @JsonProperty("payed")
    private BigDecimal repayMoney;

    /**
     * Check repeat type
     * 查重方式
     * 身份证查重、工作单位查重、手机号查询
     */
    @JsonInclude
    @JSONField(name = "checkresult")
    @JsonProperty("checkresult")
    private String checkRepeatType;

    /**
     * Data source
     * 数据来源
     * 敞口信息来源
     * 业务系统：BOSS
     * 合同系统：ICOS
     */
    @JsonInclude
    @JSONField(name = "datasource")
    @JsonProperty("datasource")
    private String dataSource;

    /**
     * Reject reason
     * 拒绝原因
     */
    @JsonInclude
    @JSONField(name = "rejectreason")
    @JsonProperty("rejectreason")
    private String rejectReason;

    /**
     * Create time
     * 创建时间
     */
    @JsonInclude
    @JSONField(name = "createtime",format = "yyyy-MM-dd HH:mm:ss")
    @JsonProperty("createtime")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;


    /**
     * 类型
     */
    @JsonInclude
    @JsonProperty("type")
    @JSONField(name = "type",serializeUsing = AfsEnumSerializer.class, deserializeUsing = AfsEnumDeserializer.class)
    @JsonSerialize(using = AfsEnumSerializer.class)
    @JsonDeserialize(using = AfsEnumDeserializer.class)
    private GwtTortoiseExposurePersonType type;


    /**
     * 合同编号，多个逗号分隔
     */
    @JsonInclude
    @JSONField(name = "contractno")
    @JsonProperty("contractno")
    private String contractNo;

    /**
     * 还款状态
     * 多个合同 逗号分隔，和合同号对应
     */
    @JsonInclude
    @JSONField(name = "repaystatus")
    @JsonProperty("repaystatus")
    private String repayStatus;

}
